package com.guo.hui.service.impl;

import java.util.List;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.guo.hui.dao.blog.TpArticleMapper;
import com.guo.hui.model.blog.TpArticle;
import com.guo.hui.page.PageParam;
import com.guo.hui.service.BlogService;

@Service("blogService")
public class BlogServiceImpl implements BlogService {

	@Autowired
	private TpArticleMapper articleDao;

	@Override
	public List<TpArticle> selectByMap(Map<String, Object> map) {
		List<TpArticle> list = articleDao.selectByMap(map);
		return list;
	}

	@Override
	public void updateByArticle(List<TpArticle> list) {
		// TODO Auto-generated method stub

	}

	@Override
	public void saveArticle(TpArticle article) {
		// TODO Auto-generated method stub

	}

	@Override
	public PageInfo<TpArticle> selectByMapPage(PageParam pageParm) {
		PageHelper.startPage(pageParm.getPage(), pageParm.getPageSize());
		List<TpArticle> list = articleDao.selectByMap(pageParm.getSearchContent());
		return new PageInfo<TpArticle>(list);
	}

}
